<template>
  <div>
    前台首页
    <button @click="getData">点击请求用户个人信息</button>
  </div>
</template>

<script setup>
import { inject } from "vue";

//inject订阅
const $axios = inject('$axios');

const getData = ()=>{
    //get请求
    $axios.get('/userinfo/admin').then( (res)=>{
        console.log(res);
        
    }).catch( (err)=>{
        console.log(err);
        
    })
}
</script>

<style>

</style>